FLT_MIN equ 1.175494351e-38
FLT_MAX equ 3.402823466e+38

;#define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
;#define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
;#define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))

DIRECTSOUND_VERSION = $800
DS_OK = S_OK

;CLSID_DirectSound GUID $47d4d946,$62e8,$11cf,<$93,$bc,$44,$45,$53,$54,0,0>
;IID_IDirectSound GUID $279AFA83,$4981,$11CE,<$A5,$21,0,$20,$AF,$B,$E5,$60>
;CLSID_DirectSound8 GUID $3901cc3f,$84b5,$4fa4,<$ba,$35,$aa,$81,$72,$b8,$a0,$9b>
;IID_IDirectSound8 GUID $C50A7E93,$F395,$4834,<$9E,$F6,$7F,$A9,$9D,$E5,$9,$66>
;CLSID_DirectSoundCapture GUID $b0210780,$89cd,$11d0,<$af,8,0,$a0,$c9,$25,$cd,$16>
;CLSID_DirectSoundCapture8 GUID $e4bcac13,$7f99,$4908,<$9a,$8e,$74,$e3,$bf,$24,$b6,$e1>
;CLSID_DirectSoundFullDuplex GUID $fea4300c,$7959,$4147,<$b2,$6a,$23,$77,$b9,$e7,$a9,$1d>
;DSDEVID_DefaultPlayback GUID $def00000,$9c6d,$47ed,<$aa,$f1,$4d,$da,$8f,$2b,$5c,3>
;DSDEVID_DefaultCapture GUID $def00001,$9c6d,$47ed,<$aa,$f1,$4d,$da,$8f,$2b,$5c,3>
;DSDEVID_DefaultVoicePlayback GUID $def00002,$9c6d,$47ed,<$aa,$f1,$4d,$da,$8f,$2b,$5c,3>
;DSDEVID_DefaultVoiceCapture GUID $def00003,$9c6d,$47ed,<$aa,$f1,$4d,$da,$8f,$2b,$5c,3>
;IID_IReferenceClock GUID $56a86897,$0ad4,$11ce,<$b0,$3a,0,$20,$af,$b,$a7,$70>
;IID_IDirectSoundBuffer GUID $279AFA85,$4981,$11CE,<$A5,$21,0,$20,$AF,$B,$E5,$60>
;IID_IDirectSoundBuffer8 GUID $6825a449,$7524,$4d82,<$92,$f,$50,$e3,$6a,$b3,$ab,$1e>
;GUID_All_Objects GUID $aa114de5,$c262,$4169,<$a1,$c8,$23,$d6,$98,$cc,$73,$b5>
;IID_IDirectSound3DListener GUID $279AFA84,$4981,$11CE,<$A5,$21,0,$20,$AF,$B,$E5,$60>
;IID_IDirectSound3DBuffer GUID $279AFA86,$4981,$11CE,<$A5,$21,0,$20,$AF,$B,$E5,$60>
;IID_IDirectSoundCapture GUID $b0210781,$89cd,$11d0,<$af,$8,0,$a0,$c9,$25,$cd,$16>
;IID_IDirectSoundCaptureBuffer GUID $b0210782,$89cd,$11d0,<$af,$8,0,$a0,$c9,$25,$cd,$16>
;IID_IDirectSoundCaptureBuffer8 GUID $990df4,$dbb,$4872,<$83,$3e,$6d,$30,$3e,$80,$ae,$b6>
;IID_IDirectSoundNotify GUID $b0210783,$89cd,$11d0,<$af,$8,0,$a0,$c9,$25,$cd,$16>
;IID_IKsPropertySet GUID $31efac30,$515c,$11d0,<$a9,$aa,0,$aa,0,$61,$be,$93>
;IID_IDirectSoundFXGargle GUID $d616f352,$d622,$11ce,<$aa,$c5,0,$20,$af,$b,$99,$a3>
;IID_IDirectSoundFXChorus GUID $880842e3,$145f,$43e6,<$a9,$34,$a7,$18,6,$e5,5,$47>
;IID_IDirectSoundFXFlanger GUID $903e9878,$2c92,$4072,<$9b,$2c,$ea,$68,$f5,$39,$67,$83>
;IID_IDirectSoundFXEcho GUID $8bd28edf,$50db,$4e92,<$a2,$bd,$44,$54,$88,$d1,$ed,$42>
;IID_IDirectSoundFXDistortion GUID $8ecf4326,$455f,$4d8b,<$bd,$a9,$8d,$5d,$3e,$9e,$3e,$b>
;IID_IDirectSoundFXCompressor GUID $4bbd1154,$62f6,$4e2c,<$a1,$5c,$d3,$b6,$c4,$17,$f7,$a0>
;IID_IDirectSoundFXParamEq GUID $c03ca9fe,$fe90,$4204,<$80,$78,$82,$33,$4c,$d1,$77,$da>
;IID_IDirectSoundFXI3DL2Reverb GUID $4b166a6a,$0d66,$43f3,<$80,$e3,$ee,$62,$80,$de,$e1,$a4>
;IID_IDirectSoundFXWavesReverb GUID $46858c3a,$dc6,$45e3,<$b7,$60,$d4,$ee,$f1,$6c,$b3,$25>
;IID_IDirectSoundCaptureFXAec GUID $ad74143d,$903d,$4ab7,<$80,$66,$28,$d3,$63,3,$6d,$65>
;IID_IDirectSoundCaptureFXNoiseSuppress GUID $ed311e41,$fbae,$4175,<$96,$25,$cd,$8,$54,$f6,$93,$ca>
;IID_IDirectSoundFullDuplex GUID $edcb4c7a,$daab,$4216,<$a4,$2e,$6c,$50,$59,$6d,$dc,$1d>
;DS3DALG_DEFAULT GUID 0,0,0,<0,0,0,0,0,0,0,0>
;DS3DALG_NO_VIRTUALIZATION GUID $c241333f,$1c1b,$11d2,<$94,$f5,0,$c0,$4f,$c2,$8a,$ca>
;DS3DALG_HRTF_FULL GUID $c2413340,$1c1b,$11d2,<$94,$f5,0,$c0,$4f,$c2,$8a,$ca>
;DS3DALG_HRTF_LIGHT GUID $c2413342,$1c1b,$11d2,<$94,$f5,$0,$c0,$4f,$c2,$8a,$ca>
;GUID_DSFX_STANDARD_GARGLE GUID $dafd8210,$5711,$4b91,<$9f,$e3,$f7,$5b,$7a,$e2,$79,$bf>
;GUID_DSFX_STANDARD_CHORUS GUID $efe6629c,$81f7,$4281,<$bd,$91,$c9,$d6,4,$a9,$5a,$f6>
;GUID_DSFX_STANDARD_FLANGER GUID $efca3d92,$dfd8,$4672,<$a6,3,$74,$20,$89,$4b,$ad,$98>
;GUID_DSFX_STANDARD_ECHO GUID $ef3e932c,$d40b,$4f51,<$8c,$cf,$3f,$98,$f1,$b2,$9d,$5d>
;GUID_DSFX_STANDARD_DISTORTION GUID $ef114c90,$cd1d,$484e,<$96,$e5,9,$cf,$af,$91,$2a,$21>
;GUID_DSFX_STANDARD_COMPRESSOR GUID $ef011f79,$4000,$406d,<$87,$af,$bf,$fb,$3f,$c3,$9d,$57>
;GUID_DSFX_STANDARD_PARAMEQ GUID $120ced89,$3bf4,$4173,<$a1,$32,$3c,$b4,6,$cf,$32,$31>
;GUID_DSFX_STANDARD_I3DL2REVERB GUID $ef985e71,$d5c7,$42d4,<$ba,$4d,$2d,7,$3e,$2e,$96,$f4>
;GUID_DSFX_WAVES_REVERB GUID $87fc0268,$9a55,$4360,<$95,$aa,0,$4a,$1d,$9d,$e2,$6c>
;GUID_DSCFX_CLASS_AEC GUID $BF963D80,$C559,$11D0,<$8A,$2B,0,$A0,$C9,$25,$5A,$C1>
;GUID_DSCFX_MS_AEC GUID $cdebb919,$379a,$488a,<87,$65,$f5,$3c,$fd,$36,$de,$40>
;GUID_DSCFX_SYSTEM_AEC GUID $1c22c56d,$9879,$4f5b,<$a3,$89,$27,$99,$6d,$dc,$28,$10>
;GUID_DSCFX_CLASS_NS GUID $e07f903f,$62fd,$4e60,<$8c,$dd,$de,$a7,$23,$66,$65,$b5>
;GUID_DSCFX_MS_NS GUID $11c5c73b,$66e9,$4ba1,<$a0,$ba,$e8,$14,$c6,$ee,$d9,$2d>
;GUID_DSCFX_SYSTEM_NS GUID $5ab0882e,$7274,$4516,<$87,$7d,$4e,$ee,$99,$ba,$4f,$d0>

interface IDirectSound,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateSoundBuffer,\
	  GetCaps,\
	  DuplicateSoundBuffer,\
	  SetCooperativeLevel,\
	  Compact,\
	  GetSpeakerConfig,\
	  SetSpeakerConfig,\
	  Initialize

interface IDirectSound8,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateSoundBuffer,\
	  GetCaps,\
	  DuplicateSoundBuffer,\
	  SetCooperativeLevel,\
	  Compact,\
	  GetSpeakerConfig,\
	  SetSpeakerConfig,\
	  Initialize,\
	  VerifyCertification

interface IDirectSoundBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCaps,\
	  GetCurrentPosition,\
	  GetFormat,\
	  GetVolume,\
	  GetPan,\
	  GetFrequency,\
	  GetStatus,\
	  Initialize,\
	  Lock,\
	  Play,\
	  SetCurrentPosition,\
	  SetFormat,\
	  SetVolume,\
	  SetPan,\
	  SetFrequency,\
	  Stop,\
	  Unlock,\
	  Restore

interface IDirectSoundBuffer8,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCaps,\
	  GetCurrentPosition,\
	  GetFormat,\
	  GetVolume,\
	  GetPan,\
	  GetFrequency,\
	  GetStatus,\
	  Initialize,\
	  Lock,\
	  Play,\
	  SetCurrentPosition,\
	  SetFormat,\
	  SetVolume,\
	  SetPan,\
	  SetFrequency,\
	  Stop,\
	  Unlock,\
	  Restore,\
	  SetFX,\
	  AcquireResources,\
	  GetObjectInPath

interface IDirectSound3DListener,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetAllParameters,\
	  GetDistanceFactor,\
	  GetDopplerFactor,\
	  GetOrientation,\
	  GetPosition,\
	  GetRolloffFactor,\
	  GetVelocity,\
	  SetAllParameters,\
	  SetDistanceFactor,\
	  SetDopplerFactor,\
	  SetOrientation,\
	  SetPosition,\
	  SetRolloffFactor,\
	  SetVelocity,\
	  CommitDeferredSettings

interface IDirectSound3DBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetAllParameters,\
	  GetConeAngles,\
	  GetConeOrientation,\
	  GetConeOutsideVolume,\
	  GetMaxDistance,\
	  GetMinDistance,\
	  GetMode,\
	  GetPosition,\
	  GetVelocity,\
	  SetAllParameters,\
	  SetConeAngles,\
	  SetConeOrientation,\
	  SetConeOutsideVolume,\
	  SetMaxDistance,\
	  SetMinDistance,\
	  SetMode,\
	  SetPosition,\
	  SetVelocity

interface IDirectSoundCapture,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  CreateCaptureBuffer,\
	  GetCaps,\
	  Initialize

interface IDirectSoundCaptureBuffer,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCaps,\
	  GetCurrentPosition,\
	  GetFormat,\
	  GetStatus,\
	  Initialize,\
	  Lock,\
	  Start,\
	  Stop,\
	  Unlock

interface IDirectSoundCaptureBuffer8,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCaps,\
	  GetCurrentPosition,\
	  GetFormat,\
	  GetStatus,\
	  Initialize,\
	  Lock,\
	  Start,\
	  Stop,\
	  Unlock,\
	  GetObjectInPath,\
	  GetFXStatus

interface IDirectSoundNotify,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetNotificationPositions

interface IKsPropertySet,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Get,\
	  Set,\
	  QuerySupport

interface IDirectSoundFXGargle,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundFXChorus,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundFXI3DL2Reverb,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters,\
	  SetPreset,\
	  GetPreset,\
	  SetQuality,\
	  GetQuality

interface IDirectSoundFXDistortion,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundFXFlanger,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundFXEcho,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundFXCompressor,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundFXParamEq,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundFXWavesReverb,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters

interface IDirectSoundCaptureFXAec,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters,\
	  GetStatus,\
	  Reset

interface IDirectSoundCaptureFXNoiseSuppress,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  SetAllParameters,\
	  GetAllParameters,\
	  Reset


interface IDirectSoundFullDuplex,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Initialize

macro MAKEDSHRESULT name,code,add {
	if add eq
	   name = $80000000+FACDS+code
	else
	   name = FACDS+code+add
	end if
}

struct DSCAPS
       dwSize dd ?
       dwFlags dd ?
       dwMinSecondarySampleRate dd ?
       dwMaxSecondarySampleRate dd ?
       dwPrimaryBuffers dd ?
       dwMaxHwMixingAllBuffers dd ?
       dwMaxHwMixingStaticBuffers dd ?
       dwMaxHwMixingStreamingBuffers dd ?
       dwFreeHwMixingAllBuffers dd ?
       dwFreeHwMixingStaticBuffers dd ?
       dwFreeHwMixingStreamingBuffers dd ?
       dwMaxHw3DAllBuffers dd ?
       dwMaxHw3DStaticBuffers dd ?
       dwMaxHw3DStreamingBuffers dd ?
       dwFreeHw3DAllBuffers dd ?
       dwFreeHw3DStaticBuffers dd ?
       dwFreeHw3DStreamingBuffers dd ?
       dwTotalHwMemBytes dd ?
       dwFreeHwMemBytes dd ?
       dwMaxContigFreeHwMemBytes dd ?
       dwUnlockTransferRateHwBuffers dd ?
       dwPlayCpuOverheadSwBuffers dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
ends

struct DSBCAPS
       dwSize dd ?
       dwFlags dd ?
       dwBufferBytes dd ?
       dwUnlockTransferRate dd ?
       dwPlayCpuOverhead dd ?
ends

struct DSEFFECTDESC
       dwSize dd ?
       dwFlags dd ?
       guidDSFXClass GUID
       dwReserved1 dq ?
       dwReserved2 dq ?
ends

DSFX_LOCHARDWARE = 1
DSFX_LOCSOFTWARE = 2

DSFXR_PRESENT = 0
DSFXR_LOCHARDWARE = 1
DSFXR_LOCSOFTWARE = 2
DSFXR_UNALLOCATED = 3
DSFXR_FAILED = 4
DSFXR_UNKNOWN = 5
DSFXR_SENDLOOP = 6

struct DSCEFFECTDESC
       dwSize dd ?
       dwFlags dd ?
       guidDSCFXClass GUID
       guidDSCFXInstance GUID
       dwReserved1 dd ?
       dwReserved2 dd ?
ends

DSCFX_LOCHARDWARE = 1
DSCFX_LOCSOFTWARE = 2
DSCFXR_LOCHARDWARE = $10
DSCFXR_LOCSOFTWARE = $20

struct DSBUFFERDESC
       dwSize dd ?
       dwFlags dd ?
       dwBufferBytes dd ?
       dwReserved dd ?
       lpwfxFormat dq ?
       guid3DAlgorithm	GUID
ends

;Older version of this structure:
struct DSBUFFERDESC1
       dwSize dd ?
       dwFlags dd ?
       dwBufferBytes dd ?
       dwReserved dd ?
       lpwfxFormat dq ?
ends

struct DS3DBUFFER
       dwSize dd ?
       vPosition D3DVECTOR
       vVelocity D3DVECTOR
       dwInsideConeAngle dd ?
       dwOutsideConeAngle dd ?
       vConeOrientation D3DVECTOR
       lConeOutsideVolume dd ?
       flMinDistance dd ?
       flMaxDistance dd ?
       dwMode dd ?
ends

struct DS3DLISTENER
       dwSize dd ?
       vPosition D3DVECTOR
       vVelocity D3DVECTOR
       vOrientFront D3DVECTOR
       vOrientTop D3DVECTOR
       flDistanceFactor  dd ?
       flRolloffFactor	dd ?
       flDopplerFactor	dd ?
ends

struct DSCCAPS
       dwSize dd ?
       dwFlags dd ?
       dwFormats dd ?
       dwChannels dd ?
ends


struct DSCBUFFERDESC1
       dwSize dd ?
       dwFlags dd ?
       dwBufferBytes dd ?
       dwReserved dd ?
       lpwfxFormat dq ?
ends

struct DSCBUFFERDESC
       dwSize dd ?
       dwFlags dd ?
       dwBufferBytes dd ?
       dwReserved dd ?
       lpwfxFormat dq ?
       dwFXCount dd ?,?
       lpDSCFXDesc dq ?
ends

struct DSCBCAPS
       dwSize dd ?
       dwFlags dd ?
       dwBufferBytes dd ?
       dwReserved dd ?
ends

struct DSBPOSITIONNOTIFY
       dwOffset dd ?,?
       hEventNotify dq ?
ends

KSPROPERTY_SUPPORT_GET = 1
KSPROPERTY_SUPPORT_SET = 2

struct DSFXGARGLE
       dwRateHz    dd ?
       dwWaveShape dd ?
ends

DSFXGARGLE_WAVE_TRIANGLE = 0
DSFXGARGLE_WAVE_SQUARE = 1

DSFXGARGLE_RATEHZ_MIN = 1
DSFXGARGLE_RATEHZ_MAX = 1000

struct DSFXCHORUS
       fWetDryMix dd ?
       fDepth dd ?
       fFeedback dd ?
       fFrequency dd ?
       lWaveform dd ?
       fDelay dd ?
       lPhase dd ?
ends

DSFXCHORUS_WAVE_TRIANGLE = 0
DSFXCHORUS_WAVE_SIN = 1

DSFXCHORUS_WETDRYMIX_MIN equ 0.0
DSFXCHORUS_WETDRYMIX_MAX equ 100.0
DSFXCHORUS_DEPTH_MIN equ 0.0
DSFXCHORUS_DEPTH_MAX equ 100.0
DSFXCHORUS_FEEDBACK_MIN equ -99.0
DSFXCHORUS_FEEDBACK_MAX equ 99.0
DSFXCHORUS_FREQUENCY_MIN equ 0.0
DSFXCHORUS_FREQUENCY_MAX equ 10.0
DSFXCHORUS_DELAY_MIN equ 0.0
DSFXCHORUS_DELAY_MAX equ 20.0
DSFXCHORUS_PHASE_MIN = 0
DSFXCHORUS_PHASE_MAX = 4

DSFXCHORUS_PHASE_NEG_180 = 0
DSFXCHORUS_PHASE_NEG_90 = 1
DSFXCHORUS_PHASE_ZERO = 2
DSFXCHORUS_PHASE_90 = 3
DSFXCHORUS_PHASE_180 = 4

struct DSFXFLANGER
       fWetDryMix dd ?
       fDepth dd ?
       fFeedback dd ?
       fFrequency dd ?
       lWaveform dd ?
       fDelay dd ?
       lPhase dd ?
ends

DSFXFLANGER_WAVE_TRIANGLE = 0
DSFXFLANGER_WAVE_SIN = 1

DSFXFLANGER_WETDRYMIX_MIN equ 0.0
DSFXFLANGER_WETDRYMIX_MAX equ 100.0
DSFXFLANGER_FREQUENCY_MIN equ 0.0
DSFXFLANGER_FREQUENCY_MAX equ 10.0
DSFXFLANGER_DEPTH_MIN equ 0.0
DSFXFLANGER_DEPTH_MAX equ 100.0
DSFXFLANGER_PHASE_MIN = 0
DSFXFLANGER_PHASE_MAX = 4
DSFXFLANGER_FEEDBACK_MIN equ -99.0
DSFXFLANGER_FEEDBACK_MAX equ 99.0
DSFXFLANGER_DELAY_MIN equ 0.0
DSFXFLANGER_DELAY_MAX equ 4.0

DSFXFLANGER_PHASE_NEG_180 = 0
DSFXFLANGER_PHASE_NEG_90 = 1
DSFXFLANGER_PHASE_ZERO = 2
DSFXFLANGER_PHASE_90 = 3
DSFXFLANGER_PHASE_180 = 4

struct DSFXECHO
       fWetDryMix dd ?
       fFeedback dd ?
       fLeftDelay dd ?
       fRightDelay dd ?
       lPanDelay dd ?
ends

DSFXECHO_WETDRYMIX_MIN equ 0.0
DSFXECHO_WETDRYMIX_MAX equ 100.0
DSFXECHO_FEEDBACK_MIN equ 0.0
DSFXECHO_FEEDBACK_MAX equ 100.0
DSFXECHO_LEFTDELAY_MIN equ 1.0
DSFXECHO_LEFTDELAY_MAX equ 2000.0
DSFXECHO_RIGHTDELAY_MIN equ 1.0
DSFXECHO_RIGHTDELAY_MAX equ 2000.0
DSFXECHO_PANDELAY_MIN = 0
DSFXECHO_PANDELAY_MAX = 1

struct DSFXDISTORTION
       fGain dd ?
       fEdge dd ?
       fPostEQCenterFrequency dd ?
       fPostEQBandwidth dd ?
       fPreLowpassCutoff dd ?
ends

DSFXDISTORTION_GAIN_MIN equ -60.0
DSFXDISTORTION_GAIN_MAX equ 0.0
DSFXDISTORTION_EDGE_MIN equ 0.0
DSFXDISTORTION_EDGE_MAX equ 100.0
DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN equ 100.0
DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX equ 8000.0
DSFXDISTORTION_POSTEQBANDWIDTH_MIN equ 100.0
DSFXDISTORTION_POSTEQBANDWIDTH_MAX equ 8000.0
DSFXDISTORTION_PRELOWPASSCUTOFF_MIN equ 100.0
DSFXDISTORTION_PRELOWPASSCUTOFF_MAX equ 8000.0

struct DSFXCOMPRESSOR
       fGain dd ?
       fAttack dd ?
       fRelease dd ?
       fThreshold dd ?
       fRatio dd ?
       fPredelay dd ?
ends

DSFXCOMPRESSOR_GAIN_MIN equ -60.0
DSFXCOMPRESSOR_GAIN_MAX equ 60.0
DSFXCOMPRESSOR_ATTACK_MIN equ 0.01
DSFXCOMPRESSOR_ATTACK_MAX equ 500.0
DSFXCOMPRESSOR_RELEASE_MIN equ 50.0
DSFXCOMPRESSOR_RELEASE_MAX equ 3000.0
DSFXCOMPRESSOR_THRESHOLD_MIN equ -60.0
DSFXCOMPRESSOR_THRESHOLD_MAX equ 0.0
DSFXCOMPRESSOR_RATIO_MIN equ 1.0
DSFXCOMPRESSOR_RATIO_MAX equ 100.0
DSFXCOMPRESSOR_PREDELAY_MIN equ 0.0
DSFXCOMPRESSOR_PREDELAY_MAX equ 4.0

struct DSFXPARAMEQ
       fCenter dd ?
       fBandwidth dd ?
       fGain dd ?
ends

DSFXPARAMEQ_CENTER_MIN equ 80.0
DSFXPARAMEQ_CENTER_MAX equ 16000.0
DSFXPARAMEQ_BANDWIDTH_MIN equ 1.0
DSFXPARAMEQ_BANDWIDTH_MAX equ 36.0
DSFXPARAMEQ_GAIN_MIN equ -15.0
DSFXPARAMEQ_GAIN_MAX equ 15.0

struct DSFXI3DL2REVERB
       lRoom dd ?
       lRoomHF dd ?
       flRoomRolloffFactor dd ?
       flDecayTime dd ?
       flDecayHFRatio dd ?
       lReflections dd ?
       flReflectionsDelay dd ?
       lReverb dd ?
       flReverbDelay dd ?
       flDiffusion dd ?
       flDensity dd ?
       flHFReference dd ?
ends

DSFX_I3DL2REVERB_ROOM_MIN = -10000
DSFX_I3DL2REVERB_ROOM_MAX = 0
DSFX_I3DL2REVERB_ROOM_DEFAULT = -1000

DSFX_I3DL2REVERB_ROOMHF_MIN = -10000
DSFX_I3DL2REVERB_ROOMHF_MAX = 0
DSFX_I3DL2REVERB_ROOMHF_DEFAULT = -100

DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN equ 0.0
DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX equ 10.0
DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT equ 0.0

DSFX_I3DL2REVERB_DECAYTIME_MIN equ 0.1
DSFX_I3DL2REVERB_DECAYTIME_MAX equ 20.0
DSFX_I3DL2REVERB_DECAYTIME_DEFAULT equ 1.49

DSFX_I3DL2REVERB_DECAYHFRATIO_MIN equ 0.1
DSFX_I3DL2REVERB_DECAYHFRATIO_MAX equ 2.0
DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT equ 0.83

DSFX_I3DL2REVERB_REFLECTIONS_MIN = -10000
DSFX_I3DL2REVERB_REFLECTIONS_MAX = 1000
DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT = -2602

DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN equ 0.0
DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX equ 0.3
DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT equ 0.007

DSFX_I3DL2REVERB_REVERB_MIN = -10000
DSFX_I3DL2REVERB_REVERB_MAX = 2000
DSFX_I3DL2REVERB_REVERB_DEFAULT = 200

DSFX_I3DL2REVERB_REVERBDELAY_MIN equ 0.0
DSFX_I3DL2REVERB_REVERBDELAY_MAX equ 0.1
DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT equ 0.011

DSFX_I3DL2REVERB_DIFFUSION_MIN equ 0.0
DSFX_I3DL2REVERB_DIFFUSION_MAX equ 100.0
DSFX_I3DL2REVERB_DIFFUSION_DEFAULT equ 100.0

DSFX_I3DL2REVERB_DENSITY_MIN equ 0.0
DSFX_I3DL2REVERB_DENSITY_MAX equ 100.0
DSFX_I3DL2REVERB_DENSITY_DEFAULT equ 100.0

DSFX_I3DL2REVERB_HFREFERENCE_MIN equ 20.0
DSFX_I3DL2REVERB_HFREFERENCE_MAX equ 20000.0
DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT equ 5000.0

DSFX_I3DL2REVERB_QUALITY_MIN = 0
DSFX_I3DL2REVERB_QUALITY_MAX = 3
DSFX_I3DL2REVERB_QUALITY_DEFAULT = 2

struct DSFXWAVESREVERB
       fInGain dd ?
       fReverbMix dd ?
       fReverbTime dd ?
       fHighFreqRTRatio dd ?
ends

DSFX_WAVESREVERB_INGAIN_MIN equ -96.0
DSFX_WAVESREVERB_INGAIN_MAX equ 0.0
DSFX_WAVESREVERB_INGAIN_DEFAULT equ 0.0
DSFX_WAVESREVERB_REVERBMIX_MIN equ -96.0
DSFX_WAVESREVERB_REVERBMIX_MAX equ 0.0
DSFX_WAVESREVERB_REVERBMIX_DEFAULT equ 0.0
DSFX_WAVESREVERB_REVERBTIME_MIN equ 0.001
DSFX_WAVESREVERB_REVERBTIME_MAX equ 3000.0
DSFX_WAVESREVERB_REVERBTIME_DEFAULT equ 1000.0
DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN equ 0.001
DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX equ 0.999
DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT equ 0.001

struct DSCFXAEC
       fEnable dd ?
       fNoiseFill dd ?
       dwMode dd ?
ends

;These match the AEC_MODE_* constants in the DDK's ksmedia.h file
DSCFX_AEC_MODE_PASS_THROUGH = 0
DSCFX_AEC_MODE_HALF_DUPLEX = 1
DSCFX_AEC_MODE_FULL_DUPLEX = 2

;These match the AEC_STATUS_* constants in ksmedia.h
DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED = 0
DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED = 1
DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED = 2
DSCFX_AEC_STATUS_CURRENTLY_CONVERGED = 8

FACDS = $08780000 ;DirectSound's facility code

struct DSCFXNOISESUPPRESS
       fEnable dd ?
ends

MAKEDSHRESULT DS_NO_VIRTUALIZATION,0,10
MAKEDSHRESULT DSERR_ALLOCATED,10
MAKEDSHRESULT DSERR_CONTROLUNAVAIL,30
MAKEDSHRESULT DSERR_INVALIDPARAM,$80070057
MAKEDSHRESULT DSERR_INVALIDCALL,50
MAKEDSHRESULT DSERR_GENERIC,$80004005
MAKEDSHRESULT DSERR_PRIOLEVELNEEDED,70
MAKEDSHRESULT DSERR_OUTOFMEMORY,$8007000E
MAKEDSHRESULT DSERR_BADFORMAT,100
MAKEDSHRESULT DSERR_UNSUPPORTED,$80004001
MAKEDSHRESULT DSERR_NODRIVER,120
MAKEDSHRESULT DSERR_ALREADYINITIALIZED,130
MAKEDSHRESULT DSERR_NOAGGREGATION,$80040110
MAKEDSHRESULT DSERR_BUFFERLOST,150
MAKEDSHRESULT DSERR_OTHERAPPHASPRIO,160
MAKEDSHRESULT DSERR_UNINITIALIZED,170
MAKEDSHRESULT DSERR_NOINTERFACE,$80004002
MAKEDSHRESULT DSERR_ACCESSDENIED,$80070005
MAKEDSHRESULT DSERR_BUFFERTOOSMALL,180
MAKEDSHRESULT DSERR_DS8_REQUIRED,190
MAKEDSHRESULT DSERR_SENDLOOP,200
MAKEDSHRESULT DSERR_BADSENDBUFFERGUID,210
MAKEDSHRESULT DSERR_OBJECTNOTFOUND,4449
MAKEDSHRESULT DSERR_FXUNAVAILABLE,220

DSCAPS_PRIMARYMONO = 1
DSCAPS_PRIMARYSTEREO = 2
DSCAPS_PRIMARY8BIT = 4
DSCAPS_PRIMARY16BIT = 8
DSCAPS_CONTINUOUSRATE = $10
DSCAPS_EMULDRIVER = $20
DSCAPS_CERTIFIED = $40
DSCAPS_SECONDARYMONO = $100
DSCAPS_SECONDARYSTEREO = $200
DSCAPS_SECONDARY8BIT = $400
DSCAPS_SECONDARY16BIT = $800

DSSCL_NORMAL = 1
DSSCL_PRIORITY = 2
DSSCL_EXCLUSIVE = 3
DSSCL_WRITEPRIMARY = 4

DSSPEAKER_DIRECTOUT = 0
DSSPEAKER_HEADPHONE = 1
DSSPEAKER_MONO = 2
DSSPEAKER_QUAD = 3
DSSPEAKER_STEREO = 4
DSSPEAKER_SURROUND = 5
DSSPEAKER_5POINT1 = 6
DSSPEAKER_7POINT1 = 7

DSSPEAKER_GEOMETRY_MIN = 5 ;5 degrees
DSSPEAKER_GEOMETRY_NARROW = $A ;10 degrees
DSSPEAKER_GEOMETRY_WIDE = $14 ;20 degrees
DSSPEAKER_GEOMETRY_MAX = $B4 ;180 degrees

DSBCAPS_PRIMARYBUFFER = 1
DSBCAPS_STATIC = 2
DSBCAPS_LOCHARDWARE = 4
DSBCAPS_LOCSOFTWARE = 8
DSBCAPS_CTRL3D = 10
DSBCAPS_CTRLFREQUENCY = $20
DSBCAPS_CTRLPAN = $40
DSBCAPS_CTRLVOLUME = $80
DSBCAPS_CTRLPOSITIONNOTIFY = $100
DSBCAPS_CTRLDEFAULT = DSBCAPS_CTRLFREQUENCY or DSBCAPS_CTRLPAN or DSBCAPS_CTRLVOLUME
DSBCAPS_CTRLALL = $1F0
DSBCAPS_CTRLFX = $200
DSBCAPS_STICKYFOCUS = $4000
DSBCAPS_GLOBALFOCUS = $8000
DSBCAPS_GETCURRENTPOSITION2 = $10000
DSBCAPS_MUTE3DATMAXDISTANCE = $20000
DSBCAPS_LOCDEFER = $40000

DSBPLAY_LOOPING = 1
DSBPLAY_LOCHARDWARE = 2
DSBPLAY_LOCSOFTWARE = 4
DSBPLAY_TERMINATEBY_TIME = 8
DSBPLAY_TERMINATEBY_DISTANCE = $10
DSBPLAY_TERMINATEBY_PRIORITY = $20

DSBSTATUS_PLAYING = 1
DSBSTATUS_BUFFERLOST = 2
DSBSTATUS_LOOPING = 4
DSBSTATUS_LOCHARDWARE = 8
DSBSTATUS_LOCSOFTWARE = $10
DSBSTATUS_TERMINATED = $20

DSBLOCK_FROMWRITECURSOR = 1
DSBLOCK_ENTIREBUFFER = 2

DSBFREQUENCY_ORIGINAL = 0
DSBFREQUENCY_MIN = 100

if DIRECTSOUND_VERSION >= $900
   DSBFREQUENCY_MAX = 200000
else
   DSBFREQUENCY_MAX = 100000
end if

DSBPAN_LEFT = -10000
DSBPAN_CENTER = 0
DSBPAN_RIGHT = 10000

DSBVOLUME_MIN = -10000
DSBVOLUME_MAX = 0

DSBSIZE_MIN = 4
DSBSIZE_MAX = $FFFFFFF
DSBSIZE_FX_MIN = 150 ;NOTE: Milliseconds, not bytes

DS3DMODE_NORMAL = 0
DS3DMODE_HEADRELATIVE = 1
DS3DMODE_DISABLE = 2

DS3D_IMMEDIATE = 0
DS3D_DEFERRED = 1

DS3D_MINDISTANCEFACTOR = FLT_MIN
DS3D_MAXDISTANCEFACTOR = FLT_MAX
DS3D_DEFAULTDISTANCEFACTOR = 1.0

DS3D_MINROLLOFFFACTOR equ 0.0
DS3D_MAXROLLOFFFACTOR equ 10.0
DS3D_DEFAULTROLLOFFFACTOR equ 1.0

DS3D_MINDOPPLERFACTOR equ 0.0
DS3D_MAXDOPPLERFACTOR equ 10.0
DS3D_DEFAULTDOPPLERFACTOR equ 1.0

DS3D_DEFAULTMINDISTANCE equ 1.0
DS3D_DEFAULTMAXDISTANCE equ 1000000000.0

DS3D_MINCONEANGLE = 0
DS3D_MAXCONEANGLE = 360
DS3D_DEFAULTCONEANGLE = 360

DS3D_DEFAULTCONEOUTSIDEVOLUME = DSBVOLUME_MAX

;IDirectSoundCapture attributes

DSCCAPS_EMULDRIVER = DSCAPS_EMULDRIVER
DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED
DSCCAPS_MULTIPLECAPTURE = 1

;IDirectSoundCaptureBuffer attributes

DSCBCAPS_WAVEMAPPED = $80000000

if DIRECTSOUND_VERSION >= $800
   DSCBCAPS_CTRLFX = $200
end if


DSCBLOCK_ENTIREBUFFER = 1

DSCBSTATUS_CAPTURING = 1
DSCBSTATUS_LOOPING = 2

DSCBSTART_LOOPING = 1

DSBPN_OFFSETSTOP = $FFFFFFFF

DS_CERTIFIED = 0
DS_UNCERTIFIED = 1


ENUM DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW,\
    DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW,\
    DSFX_I3DL2_MATERIAL_PRESET_THINDOOR,\
    DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR,\
    DSFX_I3DL2_MATERIAL_PRESET_WOODWALL,\
    DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL,\
    DSFX_I3DL2_MATERIAL_PRESET_STONEWALL,\
    DSFX_I3DL2_MATERIAL_PRESET_CURTAIN

I3DL2_MATERIAL_PRESET_SINGLEWINDOW equ -2800,0.71
I3DL2_MATERIAL_PRESET_DOUBLEWINDOW equ -5000,0.40
I3DL2_MATERIAL_PRESET_THINDOOR equ -1800,0.66
I3DL2_MATERIAL_PRESET_THICKDOOR equ -4400,0.64
I3DL2_MATERIAL_PRESET_WOODWALL equ -4000,0.50
I3DL2_MATERIAL_PRESET_BRICKWALL equ -5000,0.60
I3DL2_MATERIAL_PRESET_STONEWALL equ -6000,0.68
I3DL2_MATERIAL_PRESET_CURTAIN equ -1200,0.15


ENUM DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_CITY,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL,\
    DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE

I3DL2_ENVIRONMENT_PRESET_DEFAULT equ -1000, -100, 0.0, 1.49, 0.83, -2602, 0.007, 200, 0.011, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_GENERIC equ -1000, -100, 0.0, 1.49, 0.83, -2602, 0.007,   200, 0.011, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_PADDEDCELL equ -1000,-6000, 0.0, 0.17, 0.10, -1204, 0.001,   207, 0.002, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_ROOM equ -1000, -454, 0.0, 0.40, 0.83, -1646, 0.002,	 53, 0.003, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_BATHROOM equ -1000,-1200, 0.0, 1.49, 0.54,  -370, 0.007,  1030, 0.011, 100.0,	60.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_LIVINGROOM equ -1000,-6000, 0.0, 0.50, 0.10, -1376, 0.003, -1104, 0.004, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_STONEROOM equ -1000, -300, 0.0, 2.31, 0.64,  -711, 0.012,    83, 0.017, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_AUDITORIUM equ -1000, -476, 0.0, 4.32, 0.59,  -789, 0.020,  -289, 0.030, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_CONCERTHALL equ -1000, -500, 0.0, 3.92, 0.70, -1230, 0.020,	-2, 0.029, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_CAVE equ -1000, 0, 0.0, 2.91, 1.30,  -602, 0.015,  -302, 0.022, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_ARENA equ -1000, -698, 0.0, 7.24, 0.33, -1166, 0.020,	  16, 0.030, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_HANGAR equ -1000,-1000, 0.0,10.05, 0.23,  -602, 0.020,   198, 0.030, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY equ -1000,-4000, 0.0, 0.30, 0.10, -1831, 0.002, -1630, 0.030, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_HALLWAY equ -1000, -300, 0.0, 1.49, 0.59, -1219, 0.007,   441, 0.011, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR equ -1000, -237, 0.0, 2.70, 0.79, -1214, 0.013,	 395, 0.020, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_ALLEY equ -1000, -270, 0.0, 1.49, 0.86, -1204, 0.007,	  -4, 0.011, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_FOREST equ -1000,-3300, 0.0, 1.49, 0.54, -2560, 0.162,  -613, 0.088,  79.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_CITY equ -1000, -800, 0.0, 1.49, 0.67, -2273, 0.007, -2217, 0.011,  50.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_MOUNTAINS equ -1000,-2500, 0.0, 1.49, 0.21, -2780, 0.300, -2014, 0.100,  27.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_QUARRY equ -1000,-1000, 0.0, 1.49, 0.83,-10000, 0.061,   500, 0.025, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_PLAIN equ -1000,-2000, 0.0, 1.49, 0.50, -2466, 0.179, -2514, 0.100,  21.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_PARKINGLOT equ -1000,	  0, 0.0, 1.65, 1.50, -1363, 0.008, -1153, 0.012, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_SEWERPIPE equ -1000,-1000, 0.0, 2.81, 0.14,   429, 0.014,   648, 0.021,  80.0,  60.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_UNDERWATER equ -1000,-4000, 0.0, 1.49, 0.10,  -449, 0.007,  1700, 0.011, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_SMALLROOM equ -1000, -600, 0.0, 1.10, 0.83,  -400, 0.005,   500, 0.010, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM equ -1000, -600, 0.0, 1.30, 0.83, -1000, 0.010,  -200, 0.020, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_LARGEROOM equ -1000, -600, 0.0, 1.50, 0.83, -1600, 0.020, -1000, 0.040, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL equ -1000, -600, 0.0, 1.80, 0.70, -1300, 0.015,  -800, 0.030, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_LARGEHALL equ -1000, -600, 0.0, 1.80, 0.70, -2000, 0.030, -1400, 0.060, 100.0, 100.0, 5000.0
I3DL2_ENVIRONMENT_PRESET_PLATE equ -1000, -200, 0.0, 1.30, 0.90,     0, 0.002,	   0, 0.010, 100.0,  75.0, 5000.0
